﻿using System.Reflection;

namespace Fabrication.ValueProviders
{
    public abstract class ValueProviderBase<TParam> : IValueProvider
    {
        protected PropertyInfo Property { get; private set; }

        protected abstract TParam GetValue(object item);

        // TODO: Shouldn't need to be explicit
        void IValueProvider.Initialize(PropertyInfo property)
        {
            Property = property;
        }

        object IValueProvider.GetValue(object item)
        {
            return GetValue(item);
        }
    }
}